//
//  NSString+PYFormatContentAttributedString.m
//  catuncel
//
//  Created by Jim on 2017/12/19.
//  Copyright © 2017年 Jim. All rights reserved.
//

#import "NSString+PYFormatContentAttributedString.h"

@implementation NSString (PYFormatContentAttributedString)

- (NSAttributedString *)formatContentAttributedString
{
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    
    [paragraphStyle setLineSpacing:3];
    
    [paragraphStyle setLineBreakMode:NSLineBreakByCharWrapping];
    
    NSMutableAttributedString *attriStr = [[NSMutableAttributedString alloc] initWithString:self attributes:@{NSForegroundColorAttributeName:[UIColor colorWithWhite:34.f/255.f alpha:1], NSFontAttributeName:[UIFont systemFontOfSize:DEFAULT_FONT_SIZE weight:UIFontWeightRegular], NSParagraphStyleAttributeName:paragraphStyle}];
    
    return attriStr;
}

- (NSAttributedString *)formatBoldContentAttributedString
{
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    
    [paragraphStyle setLineSpacing:3];
    
    [paragraphStyle setLineBreakMode:NSLineBreakByCharWrapping];
    
    NSMutableAttributedString *attriStr = [[NSMutableAttributedString alloc] initWithString:self attributes:@{NSForegroundColorAttributeName:[UIColor colorWithWhite:34.f/255.f alpha:1], NSFontAttributeName:[UIFont boldSystemFontOfSize:DEFAULT_FONT_SIZE], NSParagraphStyleAttributeName:paragraphStyle}];
    
    return attriStr;
}

@end
